home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #1 / Amiga Plus CD - 2000 - No. 1.iso / Tools / Dev / Sas-PPC / samplelib2 / test.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-12-03  |  647 b   |  35 lines

  1. #include <proto/dos.h>
  2. #include <proto/exec.h>
  3.  
  4. extern void *_PPC_test1, *_PPC_test2;
  5. int b = 0;
  6.  
  7. __asm __saveds test1(void)
  8. {
  9.     struct DOSLibrary *DOSBase;
  10.     void *SysBase = *(void **)4;
  11.  
  12.     DOSBase = OpenLibrary("dos.library", 0);
  13.     if (DOSBase)
  14.     {
  15.         Write(Output(), "in test1\n", 9);
  16.         CloseLibrary(DOSBase);
  17.     }
  18.     return(b);
  19. }
  20.  
  21. __asm __saveds test2(register __d1 int a)
  22. {
  23.     struct DOSLibrary *DOSBase;
  24.     void *SysBase = *(void **)4;
  25.     
  26.     DOSBase = OpenLibrary("dos.library", 0);
  27.     if (DOSBase)
  28.     {
  29.         Write(Output(), "in test2\n", 9);
  30.         CloseLibrary(DOSBase);
  31.     }
  32.     b = a;
  33.     return(b);
  34. }
  35.